import { defineStore } from 'pinia'

export const useGchatStore = defineStore({
  id: 'gchatInfo',
  state: () => ({
    chatHistory: [],
  }),
  actions: {
    setInfo: function(data) {
      this.chatHistory = data;
    },
    getInfo: function() {
      return this.chatHistory;
    },
    removeInfo: function() {
      this.chatHistory=[];
    },
    addInfo: function(data) {
      this.chatHistory.push(data);
    },
    getCount: function() {
      return this.chatHistory.length;
  },
    leftAdd:function(data){
      this.chatHistory.unshift(data);
    }
  }
})
